Optimal. Leaf size=73 \[ -\frac{i \text{PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac{2 x \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac{x^2 \tan (a+b x)}{b}-\frac{i x^2}{b}-\frac{x^3}{3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.112149, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3720, 3719, 2190, 2279, 2391, 30} \[ -\frac{i \text{Li}_2\left (-e^{2 i (a+b x)}\right )}{b^3}+\frac{2 x \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac{x^2 \tan (a+b x)}{b}-\frac{i x^2}{b}-\frac{x^3}{3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3720
Rule 3719
Rule 2190
Rule 2279
Rule 2391
Rule 30
Rubi steps
\begin{align*} \int x^2 \tan ^2(a+b x) \, dx &=\frac{x^2 \tan (a+b x)}{b}-\frac{2 \int x \tan (a+b x) \, dx}{b}-\int x^2 \, dx\\ &=-\frac{i x^2}{b}-\frac{x^3}{3}+\frac{x^2 \tan (a+b x)}{b}+\frac{(4 i) \int \frac{e^{2 i (a+b x)} x}{1+e^{2 i (a+b x)}} \, dx}{b}\\ &=-\frac{i x^2}{b}-\frac{x^3}{3}+\frac{2 x \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac{x^2 \tan (a+b x)}{b}-\frac{2 \int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b^2}\\ &=-\frac{i x^2}{b}-\frac{x^3}{3}+\frac{2 x \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac{x^2 \tan (a+b x)}{b}+\frac{i \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{b^3}\\ &=-\frac{i x^2}{b}-\frac{x^3}{3}+\frac{2 x \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac{i \text{Li}_2\left (-e^{2 i (a+b x)}\right )}{b^3}+\frac{x^2 \tan (a+b x)}{b}\\ \end{align*}
Mathematica [B] time = 5.41029, size = 160, normalized size = 2.19 \[ \frac{-i \text{PolyLog}\left (2,e^{2 i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )+b^2 x^2 \tan (a) \sqrt{\csc ^2(a)} e^{-i \tan ^{-1}(\cot (a))}+i b x \left (2 \tan ^{-1}(\cot (a))+\pi \right )+2 \left (b x-\tan ^{-1}(\cot (a))\right ) \log \left (1-e^{2 i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )+2 \tan ^{-1}(\cot (a)) \log \left (\sin \left (b x-\tan ^{-1}(\cot (a))\right )\right )+\pi \log \left (1+e^{-2 i b x}\right )-\pi \log (\cos (b x))}{b^3}+\frac{x^2 \sec (a) \sin (b x) \sec (a+b x)}{b}-\frac{x^3}{3} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 108, normalized size = 1.5 \begin{align*} -{\frac{{x}^{3}}{3}}+{\frac{2\,i{x}^{2}}{b \left ( 1+{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) }}-{\frac{2\,i{x}^{2}}{b}}-{\frac{4\,iax}{{b}^{2}}}-{\frac{2\,i{a}^{2}}{{b}^{3}}}+2\,{\frac{x\ln \left ( 1+{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) }{{b}^{2}}}-{\frac{i{\it polylog} \left ( 2,-{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) }{{b}^{3}}}+4\,{\frac{a\ln \left ({{\rm e}^{i \left ( bx+a \right ) }} \right ) }{{b}^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.78229, size = 348, normalized size = 4.77 \begin{align*} \frac{i \, b^{3} x^{3} + 6 \,{\left (b x \cos \left (2 \, b x + 2 \, a\right ) + i \, b x \sin \left (2 \, b x + 2 \, a\right ) + b x\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) +{\left (i \, b^{3} x^{3} - 6 \, b^{2} x^{2}\right )} \cos \left (2 \, b x + 2 \, a\right ) -{\left (3 \, \cos \left (2 \, b x + 2 \, a\right ) + 3 i \, \sin \left (2 \, b x + 2 \, a\right ) + 3\right )}{\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) +{\left (-3 i \, b x \cos \left (2 \, b x + 2 \, a\right ) + 3 \, b x \sin \left (2 \, b x + 2 \, a\right ) - 3 i \, b x\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) -{\left (b^{3} x^{3} + 6 i \, b^{2} x^{2}\right )} \sin \left (2 \, b x + 2 \, a\right )}{-3 i \, b^{3} \cos \left (2 \, b x + 2 \, a\right ) + 3 \, b^{3} \sin \left (2 \, b x + 2 \, a\right ) - 3 i \, b^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.62947, size = 387, normalized size = 5.3 \begin{align*} -\frac{2 \, b^{3} x^{3} - 6 \, b^{2} x^{2} \tan \left (b x + a\right ) - 6 \, b x \log \left (-\frac{2 \,{\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) - 6 \, b x \log \left (-\frac{2 \,{\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) - 3 i \,{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + 3 i \,{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right )}{6 \, b^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \tan ^{2}{\left (a + b x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \tan \left (b x + a\right )^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]